<!--
 * @Author: C.
 * @Date: 2023-03-09 17:35:04
-->
<template>
  <PageWrapper :title="t('routes.process.menu.craftTemplateDetail')" contentBackground>
    <template #extra>
      <a-button type="primary" @click="toEdit"> {{ t('common.edit') }} </a-button>
      <Button @click="change">change</Button>
    </template>
    <Card :title="t('routes.process.menu.craftTemplateDetail')">
      <Description @register="descRegister" />
    </Card>
    <AuditFlow :process="process" />
  </PageWrapper>
</template>

<script lang="ts" setup name="craftTemplate_detail">
  import { onMounted, ref } from 'vue';
  import { Card, Button } from 'ant-design-vue';

  import { PageWrapper } from '/@/components/Page';
  import { Description, useDescription } from '/@/components/Description/index';
  import { useAppRouter } from '/~/hooks/help/useAppRouter';

  import { descSchemas } from './config';
  import { useI18n } from '/@/hooks/web/useI18n';
  import { AuditFlow } from '/~/components/AuditFlow';
  const { closeTo } = useAppRouter();
  const { t } = useI18n();
  // 1646353989446402049
  const [descRegister, {}] = useDescription({
    data: {},
    schema: descSchemas,
  });
  onMounted(() => {
    fetchDetail();
    setTimeout(() => {
      process.value = arr;
    }, 2000);
  });
  async function fetchDetail() {}
  function toEdit() {
    closeTo({
      name: 'craftTemplate_edit',
    });
  }
  const arr = [
    {
      Id: '1542735479328210946',
      Name: '第一个到付哈地方',
      BillKey: 'Sa_Order',
      ApproveType: 'OptionallySign',
      ApproveOrder: 0,
      ApproverType: 'Personnel',
      ActivationCondition: '',
      ApproverRole: '',
      ApproveState: 'Approved',
      Creator: 'Henry',
      CreationDate: '2022-06-29T14:17:20.477',
      BillGui: '1542029430782689281',
      BillId: 'SA220629009',
      NodeCreationDate: '2022-07-08T13:00:00',
      ApprovedAt: '2022-07-01T13:02:58.567',
      ApproveNodeUsers: [
        {
          Id: 1051,
          ApproveNodeId: '1542735479328210946',
          UserId: 'cj',
          UserName: 'Henry',
          BillKey: 'Sa_Order',
          ApproveState: 'Approved',
          ApprovedAt: '2022-07-01T13:02:58.567',
          Remarks: null,
        },
        {
          Id: 1052,
          ApproveNodeId: '1542735479328210946',
          UserId: 'hsy',
          UserName: 'Tim',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1053,
          ApproveNodeId: '1542735479328210946',
          UserId: 'lhx',
          UserName: 'Mark',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1054,
          ApproveNodeId: '1542735479328210946',
          UserId: 'lxh',
          UserName: 'Tom',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1055,
          ApproveNodeId: '1542735479328210946',
          UserId: 'ljd',
          UserName: '林进东',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1056,
          ApproveNodeId: '1542735479328210946',
          UserId: 'pxx',
          UserName: '彭枭雄',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1057,
          ApproveNodeId: '1542735479328210946',
          UserId: 'wedm',
          UserName: '王明',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1058,
          ApproveNodeId: '1542735479328210946',
          UserId: 'cnc',
          UserName: '张大勇',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1059,
          ApproveNodeId: '1542735479328210946',
          UserId: 'ZZL',
          UserName: '张洲林',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1060,
          ApproveNodeId: '1542735479328210946',
          UserId: 'zcl9',
          UserName: '钟聪霖',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1061,
          ApproveNodeId: '1542735479328210946',
          UserId: 'zcl',
          UserName: '钟聪霖',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1041,
          ApproveNodeId: '1542735479328210946',
          UserId: '1',
          UserName: '2',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1042,
          ApproveNodeId: '1542735479328210946',
          UserId: 'admin',
          UserName: 'admin',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1043,
          ApproveNodeId: '1542735479328210946',
          UserId: 'VKB002',
          UserName: 'CAM01',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1044,
          ApproveNodeId: '1542735479328210946',
          UserId: 'lwj',
          UserName: 'Jackey Lu',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1045,
          ApproveNodeId: '1542735479328210946',
          UserId: 'vkb004',
          UserName: 'liyong',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1046,
          ApproveNodeId: '1542735479328210946',
          UserId: 'VKB005',
          UserName: 'QC',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1047,
          ApproveNodeId: '1542735479328210946',
          UserId: 'VKB001',
          UserName: 'sheji01',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1048,
          ApproveNodeId: '1542735479328210946',
          UserId: 'TT',
          UserName: 'TT',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1049,
          ApproveNodeId: '1542735479328210946',
          UserId: 'vkb003',
          UserName: 'XIANCHANG',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
        {
          Id: 1050,
          ApproveNodeId: '1542735479328210946',
          UserId: 'test1',
          UserName: '测试用户',
          BillKey: 'Sa_Order',
          ApproveState: 'Skipped',
          ApprovedAt: null,
          Remarks: null,
        },
      ],
    },
    {
      Id: '1542735479458234370',
      Name: '审核人',
      BillKey: 'Sa_Order',
      ApproveType: 'JointlySign',
      ApproveOrder: 1,
      ApproverType: 'Personnel',
      ActivationCondition: '',
      ApproverRole: '',
      ApproveState: 'Approved',
      Creator: 'Henry',
      CreationDate: '2022-06-29T14:17:20.477',
      BillGui: '1542029430782689281',
      BillId: 'SA220629009',
      NodeCreationDate: '2022-07-08T13:00:00',
      ApprovedAt: '2022-07-11T19:36:39.337',
      ApproveNodeUsers: [
        {
          Id: 1063,
          ApproveNodeId: '1542735479458234370',
          UserId: 'pxx',
          UserName: '彭枭雄',
          BillKey: 'Sa_Order',
          ApproveState: 'Approved',
          ApprovedAt: '2022-07-11T19:36:39.337',
          Remarks: '222',
        },
        {
          Id: 1062,
          ApproveNodeId: '1542735479458234370',
          UserId: 'cj',
          UserName: 'Henry',
          BillKey: 'Sa_Order',
          ApproveState: 'Approved',
          ApprovedAt: '2022-07-01T13:03:00.877',
          Remarks: null,
        },
      ],
    },
    {
      Id: '1542735479479205889',
      Name: '审核人',
      BillKey: 'Sa_Order',
      ApproveType: 'JointlySign',
      ApproveOrder: 2,
      ApproverType: 'Role',
      ActivationCondition: '',
      ApproverRole: '审核测试',
      ApproveState: 'WaitToProcess',
      Creator: 'Henry',
      CreationDate: '2022-06-29T14:17:20.477',
      BillGui: '1542029430782689281',
      BillId: 'SA220629009',
      NodeCreationDate: '2022-07-08T13:00:00',
      ApprovedAt: null,
      ApproveNodeUsers: [
        {
          Id: 1064,
          ApproveNodeId: '1542735479479205889',
          UserId: 'cj',
          UserName: 'Henry',
          BillKey: 'Sa_Order',
          ApproveState: 'WaitToProcess',
          ApprovedAt: null,
          Remarks: null,
        },
      ],
    },
    {
      Id: '1542735479537926146',
      Name: '审核人',
      BillKey: 'Sa_Order',
      ApproveType: 'JointlySign',
      ApproveOrder: 3,
      ApproverType: 'Personnel',
      ActivationCondition: '',
      ApproverRole: '',
      ApproveState: 'WaitToProcess',
      Creator: 'Henry',
      CreationDate: '2022-06-29T14:17:20.477',
      BillGui: '1542029430782689281',
      BillId: 'SA220629009',
      NodeCreationDate: '2022-07-08T13:00:00',
      ApprovedAt: null,
      ApproveNodeUsers: [
        {
          Id: 1065,
          ApproveNodeId: '1542735479537926146',
          UserId: 'cj',
          UserName: 'Henry',
          BillKey: 'Sa_Order',
          ApproveState: 'WaitToProcess',
          ApprovedAt: null,
          Remarks: null,
        },
      ],
    },
  ];
  const process = ref([]);
  function change() {
    setTimeout(() => {
      process.value = [];
    }, 2000);
  }
</script>
<style lang="less" scoped></style>
